<template>
  <div class="home">
    <el-container>
      <el-header>
        <div class="title">星际轨道</div>
        <el-menu
          class="curruser"
          @select="myinfo"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-s-custom"></i>
              <span>curruser.m_name</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="1">修改密码</el-menu-item>
              <el-menu-item index="2">退出登录</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-header>
      <el-container>
        <el-aside style="width:200px">
          <el-menu
            class="my-menu"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-edit-outline"></i>
                <span>修改菜单</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">修改权限</el-menu-item>
                <el-menu-item index="1-2">修改导入条数</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-search"></i>
                <span>查询菜单</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="2-1">查询用户</el-menu-item>
                <el-menu-item index="2-2">查询数据</el-menu-item>
                <el-menu-item index="2-3">查询操作人记录</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-tickets"></i>
                <span>任务菜单</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="3-1">获取任务</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-container>
          <el-main>
             <router-view />
          </el-main>
          <el-footer style="height:30px">版权所有:&copy;星河软件开发有限公司</el-footer>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "Home",
  data(){
    return{
      curruser:{
        m_id:'',
        m_name:'',
      }

    }
  },
  methods:{
    myinfo(index){
      if(index==1){
        this.$router.push('/'); // 跳转至修改密码页
      }else{
        this.$router.push('/');
      }

    }
  },
  mounted(){

  }

};
</script>

<style scoped>
.home {
  height: 100%;
  width: 100%;
  
}
.el-container {
  height: 100%;
  width: 100%;
  
}
.el-header {
  display: flex;
  flex: column;
  justify-content: space-between;
  padding: 0px;
  height: 100%;
  width: 100%;
  background-color: #545c64;
}
.title {
  padding: 0px 10px;
  font-size: 45px;
  color: #ffd04b;
  background-color: rgb(40, 41, 43);
  display: flex;
  align-items: center;
}

.curruser {
  width: 200px;
  height: 100%;
  padding: 0px;
}
.my-menu{
  height: 100%;
  width: auto;
}
.el-aside{
  height: 100%;
}
.el-footer {
  height: 50%;
  background-color: rgb(160, 161, 163);
  width: 100%;
}


</style>
